//package com.qf.consumer.service;//package com.qf.consumer.service;
//
//import com.rabbitmq.client.Channel;
//import lombok.extern.slf4j.Slf4j;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.amqp.ImmediateAcknowledgeAmqpException;
//import org.springframework.amqp.core.Message;
//import org.springframework.amqp.rabbit.annotation.RabbitHandler;
//import org.springframework.amqp.rabbit.annotation.RabbitListener;
//import org.springframework.stereotype.Service;
//
//import java.io.IOException;
//
///**
// * description
// *
// * @author TangLin
// * @date 2020年08月10日 16:19
// */
//@Service
////@RabbitListener(queues = {"queue1","queue2"})
//@RabbitListener(queues = "queue1")
//public class ReceiveMsgService3 {
//    Logger log = LoggerFactory.getLogger(ReceiveMsgService3.class);
//
//    @RabbitHandler
//    public void processHandler(String msg, Channel channel, Message message) throws IOException {
//
//        try {
//            log.info("消费者收到：{}", msg);
//            //重复投递问题
//            System.out.println(1/0);
//            channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
//
//        } catch (Exception e) {
//
//
//            channel.basicNack(message.getMessageProperties().getDeliveryTag(), false, true);
//        }
//
//
//    }
//
//}
